import json
import requests



url = "https://api.binance.com/api/v3/exchangeInfo"
req = requests.get(url)
all_data = json.loads(req.content)
symbols = all_data['symbols']
print(f"所有币种数量:{len(symbols)}")
symbols = [(x['symbol'], x['baseAsset'], x['quoteAsset']) for x in symbols if x['status'] == 'TRADING']
print(f"正常交易的币种数量:{len(symbols)}")
for pair, baseAsset, quoteAsset in symbols:
    print(f"{baseAsset}/{quoteAsset}")
    assert pair == baseAsset + quoteAsset